UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qbLTGMdDoIoMM3qaZo+cPOMUgkZSZxEylT0XRm1qf3A='
WHERE
key_id = 'd5a5ad50345e4a8c8b652eb7933e3d24fb05e1ece9eafcb8d9bc3a23ffe52700'
AND (
token = 'qbLTGMdDoIoMM3qaZo+cPOMUgkZSZxEylT0XRm1qf3A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)