UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ix7FCYku6UYDwpun+9YNwvZ7H38OSgrMFOb/owO5uxI=' 
WHERE 
  key_id = 'b627a79ed2d094c1b0323fca44d18363dcb7b5ad70f077f1ecf68a7ba08e66dc' 
  AND (
    token = 'Ix7FCYku6UYDwpun+9YNwvZ7H38OSgrMFOb/owO5uxI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021