UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eao5iX57V4PoYGH5giP60vmqdRCb4v76FMaXXdiHYvI=' 
WHERE 
  key_id = 'a29c4929c5d788c2eea007c4b5c0d7da62bcd918c61a87d9ca87609f3e21d8bb' 
  AND (
    token = 'eao5iX57V4PoYGH5giP60vmqdRCb4v76FMaXXdiHYvI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026