UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nzr0OV/3oEl3AMo3NPFyzooFQYCvO2L5H6ZxPfxB8AM='
WHERE
key_id = '69c8ba67ab10f022900e91a787a70614a2207422cce251b0395a0147c763b59c'
AND (
token = 'nzr0OV/3oEl3AMo3NPFyzooFQYCvO2L5H6ZxPfxB8AM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)