UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dM0cljeZrLTUmUi0Uq/5Xk9wdCYFA3/zC36DQxWDfIE='
WHERE
key_id = 'dfc1a367680d7bdc7abb7758c2d86bfda231b1d9d242e56bf58864cd3677a12a'
AND (
token = 'dM0cljeZrLTUmUi0Uq/5Xk9wdCYFA3/zC36DQxWDfIE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)