UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dhi8R6KCZDq4uyJ/7FuFK7OZ9IwWZ6xTyixLJnNSgJI='
WHERE
key_id = 'e4323797d75adf8a8a671909668ffaf83b49a58b866b59b2cd4c3f7b91ef2c78'
AND (
token = 'dhi8R6KCZDq4uyJ/7FuFK7OZ9IwWZ6xTyixLJnNSgJI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)