UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SbpaWE2eZ3vxD1+TrWS4/4D4tVc6vELg2RkC8NMi0nw='
WHERE
key_id = 'a91190532b1d6c7de9a9abc342dec7aa960f1862e86078e8d8ae963532dd8ab1'
AND (
token = 'SbpaWE2eZ3vxD1+TrWS4/4D4tVc6vELg2RkC8NMi0nw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)