UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l82LYR0fcUnat9/k/0zqbIXib7BAam0NbfAyXNsg1nI=' 
WHERE 
  key_id = 'dbee50c8c8416974f34690c4528702ebcea05bc3af2372031843cbd3b39783f0' 
  AND (
    token = 'l82LYR0fcUnat9/k/0zqbIXib7BAam0NbfAyXNsg1nI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025