UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DCcPriPnydGQLrHTFpL29WlF9uvBSIujldvzCZglTr0='
WHERE
key_id = 'ee664d79f6bcaca231125ab0732227f2ce3bcf1244483d1cdc3f0ca5900d34f6'
AND (
token = 'DCcPriPnydGQLrHTFpL29WlF9uvBSIujldvzCZglTr0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)