UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kmcAq/D6Fh1AYXTKb6J+Mdz39IY7hzM7B8kSnDZc70M=' 
WHERE 
  key_id = '9ae08af45fa0ec375abcc6398b0b0adb0ab2b7f192619333decf8dd9e73479b6' 
  AND (
    token = 'kmcAq/D6Fh1AYXTKb6J+Mdz39IY7hzM7B8kSnDZc70M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026