UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UwiOxRmb/sO7HqhvGvJ+nUf3+tLdl+XbYP76O5RC6Zg=' 
WHERE 
  key_id = '3cc70536fee92dcf3c9812c73c81f2b99c8b7fbace351dd39f9b87deaa9980a3' 
  AND (
    token = 'UwiOxRmb/sO7HqhvGvJ+nUf3+tLdl+XbYP76O5RC6Zg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025