UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'f5ru5sSTwOdzV2VGndqHkfTo1rTiD1+OAWH/6FpNKA0=' 
WHERE 
  key_id = '2fc16780f1a3556ce094219d71c032aedf90c3419778dfbcb342151d6b4dfe5b' 
  AND (
    token = 'f5ru5sSTwOdzV2VGndqHkfTo1rTiD1+OAWH/6FpNKA0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031