UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9ZARcv7HTjvh51eiweTDO6aYnQ5VuJihfP5dfROgy98='
WHERE
key_id = 'cb5efbea45bb918a78fc0a7582ac3c404a0542a98a0ae9dbf870db96e8b242b9'
AND (
token = '9ZARcv7HTjvh51eiweTDO6aYnQ5VuJihfP5dfROgy98='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)