UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/gVHjm9ckpximO+YbDbXVkBtpJRQPaFScXOiXlyZXYA='
WHERE
key_id = 'b02c5d170a37737c86302135e2a0e462005ad1a7a84c9d5daefc6a810da53b93'
AND (
token = '/gVHjm9ckpximO+YbDbXVkBtpJRQPaFScXOiXlyZXYA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)