UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '29NT8e1fQxWwBAJiaQGviHWaN7edpv6ijq6cafGAJHE=' 
WHERE 
  key_id = '4569f4ea5c911c3640e5bcd088ac7b5df5e2fb64487c25168d10b7f5e35e1138' 
  AND (
    token = '29NT8e1fQxWwBAJiaQGviHWaN7edpv6ijq6cafGAJHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034