UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rO71gWeRVhDzqfUCX7eeSh95UvWcrSbatx0AkUbE+uU=' 
WHERE 
  key_id = '466eece73d4ca34b64de75f50e9d2fa73c54dddf96ec5b0eb354e23473f31559' 
  AND (
    token = 'rO71gWeRVhDzqfUCX7eeSh95UvWcrSbatx0AkUbE+uU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030