UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XoDjopjasHESjPvQsxILdsxbFksrBNJkDHC8H2N/i7w=' 
WHERE 
  key_id = '899089cb9b2dc069284a38f626590f8cce646d4b1e3530a0e93a5e02680d12a2' 
  AND (
    token = 'XoDjopjasHESjPvQsxILdsxbFksrBNJkDHC8H2N/i7w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033