UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LtdIR4d7V4aB7+jg4ADXM6CDyor4/QKQFLhjF03i63s=' 
WHERE 
  key_id = '6ed4264ca55cc60d0d0c31de84c8d3b5566f48b45a6b8a453a0836df772531ce' 
  AND (
    token = 'LtdIR4d7V4aB7+jg4ADXM6CDyor4/QKQFLhjF03i63s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026