UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QXpbC/eRbGMZhxk4BdZrhB8HWZQXuuZu6QnHTyqHElg=' 
WHERE 
  key_id = '0f9e6ffd86883e91a4fa1aee12341212a5a29cf7a9736c87308f5c43d1682d17' 
  AND (
    token = 'QXpbC/eRbGMZhxk4BdZrhB8HWZQXuuZu6QnHTyqHElg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031