UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nto/qLxUeGIVGKhAxEIhHfsYkelV8tQ8tDBnRfXEJZM=' 
WHERE 
  key_id = '44468228481e071dc486652c6737044932beb248911f69156c3ce28911faee1e' 
  AND (
    token = 'Nto/qLxUeGIVGKhAxEIhHfsYkelV8tQ8tDBnRfXEJZM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031