UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h5s3NewqncmVkHJJ8s1+uj7qTc/SGVcg9QPiVAOPalk='
WHERE
key_id = '91c5d0b9d7585136feef71807fcb827911002a0ca0c20651f4957563538fc5b8'
AND (
token = 'h5s3NewqncmVkHJJ8s1+uj7qTc/SGVcg9QPiVAOPalk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)