UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '60/+Kwi097cASBIlS1v4srAfn0/n7hwYKlBSivwWDvE=' 
WHERE 
  key_id = 'e3a986962eefc66555fce4f9dff661f64603500efc5ed2bcd2b2dc0effa979df' 
  AND (
    token = '60/+Kwi097cASBIlS1v4srAfn0/n7hwYKlBSivwWDvE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037