UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VecClwJnV2tPbGlt+0WHpIjrhwQj/MS37k4vYvyED+4=' 
WHERE 
  key_id = 'fab0ece054128d0d3c44210e9495074dd80dbdc1b7c879294ddf04e36ec62ba9' 
  AND (
    token = 'VecClwJnV2tPbGlt+0WHpIjrhwQj/MS37k4vYvyED+4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024