UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qqITABFJFpvnagsNW3jj35Oh2FO6K9Ng9xWkua6QYDI='
WHERE
key_id = 'e6aea8ecf7123957c91b7efd92afe231070e3d54103aefae960fb53a4df30bb6'
AND (
token = 'qqITABFJFpvnagsNW3jj35Oh2FO6K9Ng9xWkua6QYDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)