UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7vN64/Kcs/iehpfU+wQ8wVd0VTyq7HtfS4NJEu4A9f4=' 
WHERE 
  key_id = '6d0b4e84739c38ad91775b873bdac23b4516ac2520883e3216b076db2404cae9' 
  AND (
    token = '7vN64/Kcs/iehpfU+wQ8wVd0VTyq7HtfS4NJEu4A9f4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033