UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '10a1rfrOban7QoOyTpe9REcCs0sncNQRXIyJ4y+mh8o=' 
WHERE 
  key_id = 'db4a26eccd547a8ffd8c680d52592d59377076b106648ac3368d22b74349ab2c' 
  AND (
    token = '10a1rfrOban7QoOyTpe9REcCs0sncNQRXIyJ4y+mh8o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037