UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3zp/pSIPsRYuW50gICHEJ8QN0S0ITZwN0YpaFiJLmG0=' 
WHERE 
  key_id = '5b1d642fd9f2f4514c581e324afac84157a616ea9b001b7e049362a05fc58126' 
  AND (
    token = '3zp/pSIPsRYuW50gICHEJ8QN0S0ITZwN0YpaFiJLmG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00055