UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'm6I4kG3HhjgCPMtz9iDHnj6bYrnIJniR+sBtCSrbe1I=' 
WHERE 
  key_id = '002ad2a5a6f2b164b173f6b734694779e57ee73defc2071d3f1d4f287d33a2a5' 
  AND (
    token = 'm6I4kG3HhjgCPMtz9iDHnj6bYrnIJniR+sBtCSrbe1I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025