UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/RSCvbiDRngSYRuOQsGZpuAJEK81jwhWE3Ta+3rei1Q='
WHERE
key_id = '5cbd524cdfe1d3deddbec6c8597726b9bb4c07ccdcfdc68221444c07a63b9ca7'
AND (
token = '/RSCvbiDRngSYRuOQsGZpuAJEK81jwhWE3Ta+3rei1Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)