UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rr1k3uKdlK0Pg1BmuhIRZOsQYirM8SoBEHj5M8JCB4g=' 
WHERE 
  key_id = '73f98f061e2b05486e8caff278f08e115de5a8eb847be7ab8da2cc6f6231fa08' 
  AND (
    token = 'rr1k3uKdlK0Pg1BmuhIRZOsQYirM8SoBEHj5M8JCB4g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038