UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WcPpaQXMtEfW8k1HnCgj3+W5qTH65W2/5cePhQRAKDQ=' 
WHERE 
  key_id = '98fd53aada2cd1aab2f8126d4489016c6d08b0aa0907234f247fbf58c4799427' 
  AND (
    token = 'WcPpaQXMtEfW8k1HnCgj3+W5qTH65W2/5cePhQRAKDQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052