UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zg03RA76YRcWiFqh8pahvnoevMheQGR4KjenPDAZqGE=' 
WHERE 
  key_id = '011056d41479fa4f5d67fb9d5389fcc310d79d06d8d1ad26caf6ae0b20835466' 
  AND (
    token = 'zg03RA76YRcWiFqh8pahvnoevMheQGR4KjenPDAZqGE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033