UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+dhPDBBKyfmb6AFQP2yPJ7/Q7EmTpJBpHS9/XZnksRw=' 
WHERE 
  key_id = '4219233c10dc00b1b5b311f353c3e30550b14afa112ae1ddf7bee5cfbd9d02a2' 
  AND (
    token = '+dhPDBBKyfmb6AFQP2yPJ7/Q7EmTpJBpHS9/XZnksRw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039