UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '74eLIpNCvidwumfHypEb7OcrlgWC34eoohF0kH2Jh4c='
WHERE
key_id = '0358f9b7e071a0ff703fea3d1c71f6995668bd65665a66c89a917e254a883c07'
AND (
token = '74eLIpNCvidwumfHypEb7OcrlgWC34eoohF0kH2Jh4c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)