UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DUN1RZ5elz6PcF/zqJwY2GUtKrSynSpFMqCgkZZFW8s=' 
WHERE 
  key_id = 'da8324f0daa8e4598dabf9b487621c96ddc73266d437d5d7fd4a102dc2cacf2c' 
  AND (
    token = 'DUN1RZ5elz6PcF/zqJwY2GUtKrSynSpFMqCgkZZFW8s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045