UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Cop34BSPHI76zioXHmb5syYk+UNt2EqCl/bGWsvr0aA=' 
WHERE 
  key_id = '811ae951c53fcf03f12bb7acedebf2e0c0a4d6be2526383af9ca16cb5cb8057e' 
  AND (
    token = 'Cop34BSPHI76zioXHmb5syYk+UNt2EqCl/bGWsvr0aA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030