UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/5dOZprmUn+sjEwqYNJH/1qlz/Gqgb+N8VDWS7trVgA=' 
WHERE 
  key_id = '9ae0cd04316d9cb547f25b69da570cf05f03ee1f2d2801af1b2785af9ce3ef63' 
  AND (
    token = '/5dOZprmUn+sjEwqYNJH/1qlz/Gqgb+N8VDWS7trVgA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046