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

Query time 0.00023