UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'zxRNzzNNAYZWGh+Y8hdLcMCPPWRl8nVoh4mc328z7vI='
WHERE
key_id = '20888e692b1280c72c7d279af1e3517360d53b7c0480798e49e7792183b1aa53'
AND (
token = 'zxRNzzNNAYZWGh+Y8hdLcMCPPWRl8nVoh4mc328z7vI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)