UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nSBEk9cIXNolD57zEgXQa5H4kJiN359cHLOm6i6fkhM='
WHERE
key_id = '3cc052f2f756b78146cc5bd04679a53c94999af5d6b8029acf3e4cf2e8300605'
AND (
token = 'nSBEk9cIXNolD57zEgXQa5H4kJiN359cHLOm6i6fkhM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)