UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eOOBrYeqPI3xlk+dv+ZVLsn+JgmOIKpFyngN/IwOuE8=' 
WHERE 
  key_id = 'b27181bb02636bc4602a67d927fe4e8a8debd525975e72d715a1676b47d429f3' 
  AND (
    token = 'eOOBrYeqPI3xlk+dv+ZVLsn+JgmOIKpFyngN/IwOuE8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027