UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 's65xAXxFknv/q+Y3N0CNOsawUffGoDIxNRCDJFyCTjc=' 
WHERE 
  key_id = '2a411fea491eac2407026ae644696b173bfa2feba4e75904676d0c2c633f7858' 
  AND (
    token = 's65xAXxFknv/q+Y3N0CNOsawUffGoDIxNRCDJFyCTjc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041