UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iZBGYOs2wyjVhn8Cb73KzH/eyzFceFCXXn3pSbIFwmM=' 
WHERE 
  key_id = '3117c54269a4e2a3109dd3d05cc933c050ad70e3bd6ba3e05d6b07b64198d0dd' 
  AND (
    token = 'iZBGYOs2wyjVhn8Cb73KzH/eyzFceFCXXn3pSbIFwmM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019