UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fYjARB940WnhjW463zeO7Q76wv7AgVC4N4f46uMKp9w=' 
WHERE 
  key_id = '45fa98cb058f9d9f654c92ad94e2e99d805e7a3ecb18c462bc34e14709f306af' 
  AND (
    token = 'fYjARB940WnhjW463zeO7Q76wv7AgVC4N4f46uMKp9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044