UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rZJw3RgvRt2pnenZ4gTFUvJjw4qMdWZJTcmGg6a+14A='
WHERE
key_id = '37334ef5e55ee5fcdbc0ea0e92ca437c2a690958752665ff336349adcb502bb7'
AND (
token = 'rZJw3RgvRt2pnenZ4gTFUvJjw4qMdWZJTcmGg6a+14A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)