UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9vbSzSd/mpbODygKJ+TCMb2J/d5HASw9r2HDHCxQrW0='
WHERE
key_id = '2464dc7001bfa325af4f0387c3dafb9fe35301e6b37fe9143abcba4d21761ac1'
AND (
token = '9vbSzSd/mpbODygKJ+TCMb2J/d5HASw9r2HDHCxQrW0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)