UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5yvqV/IB6Ast2uj++/ORuKirXKnFBZ4jGphlGVK2pwU=' 
WHERE 
  key_id = '9a734e58acd1d75970548d87a5606aaa6cff1f3e0ca61c70f0cd23549011045e' 
  AND (
    token = '5yvqV/IB6Ast2uj++/ORuKirXKnFBZ4jGphlGVK2pwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035