UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/ASrnJp2WInDyK96TSWwtKHVMaamfRT14xp7K59w2ls='
WHERE
key_id = 'c522fc41f1d7200de61e8bdfdef50c471b66f41a0122320ddde6fd6c1a7cf178'
AND (
token = '/ASrnJp2WInDyK96TSWwtKHVMaamfRT14xp7K59w2ls='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)