UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'drAW+2rGIVS6Maq8I1CR27IIvZbfiPfT18bUReZax/g=' 
WHERE 
  key_id = 'affff77a81efd75d47a0b7fd4fcda5a182af26eb12a57179bbafc5d9f576abee' 
  AND (
    token = 'drAW+2rGIVS6Maq8I1CR27IIvZbfiPfT18bUReZax/g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036