UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3HaxxAKfJ2H4Kn1ccTx0aBiTuW397lVMnqr2N+NN5qA=' 
WHERE 
  key_id = 'dbdaed73ab6a4ea37beeee9ea7b07de58e1d665ce8c8b019cacaa5fa7a71ac8c' 
  AND (
    token = '3HaxxAKfJ2H4Kn1ccTx0aBiTuW397lVMnqr2N+NN5qA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017