UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7vGv1jiJ//WFPMbOfx/qcSg0xbjWW8o3VedEzIyeZwI='
WHERE
key_id = 'a628d2053540e9bb5470ca4dcdb5721eca1dbffbe7a390565a3ca2389f020c12'
AND (
token = '7vGv1jiJ//WFPMbOfx/qcSg0xbjWW8o3VedEzIyeZwI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)