UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4bQSfwY3OJqZNjtIPxTalvS705gNwBjNcYUCrFqLhKo=' 
WHERE 
  key_id = 'a7bf92e3d121842a672af593ab2430d93cd4d7cbabe75365ed767e29918ae34a' 
  AND (
    token = '4bQSfwY3OJqZNjtIPxTalvS705gNwBjNcYUCrFqLhKo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047