UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kbXtkTts6Blw58JOWj41dU8kf/eXOLbUSbaTcMBp604=' 
WHERE 
  key_id = '29df6be647d443eaf616b6bcaef2e1f638d5b455a2c0f0d98974b59c904adb97' 
  AND (
    token = 'kbXtkTts6Blw58JOWj41dU8kf/eXOLbUSbaTcMBp604=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014