UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0hjlZfqum/rJXinwgBgN96LlmBhix+wEj+p5MNV/cm4='
WHERE
key_id = 'e9cc52a71541b5a4b40e69ea8052372fb6eca27c68cb6501dd5825c3b370ba31'
AND (
token = '0hjlZfqum/rJXinwgBgN96LlmBhix+wEj+p5MNV/cm4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)