UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4XCJH6/qXiHvQJbxMdWI/kZ4/QlmvfESb0nYuEaTioo='
WHERE
key_id = '46a203de34edceda7e52ef3d983bdef06a6e46db731e288dc7d142243aa4e36e'
AND (
token = '4XCJH6/qXiHvQJbxMdWI/kZ4/QlmvfESb0nYuEaTioo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)