UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zzkz6yuOI/OvgbzXBIpoDz2ZyI7co3KXJtYa1WrKKsw=' 
WHERE 
  key_id = '65ece382db1bdaa39112a906c535d2b65eef9891183acf2a4db2bd08106e3f0e' 
  AND (
    token = 'Zzkz6yuOI/OvgbzXBIpoDz2ZyI7co3KXJtYa1WrKKsw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034