UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FEO721THR87BzZuklv/YQpe6VobKgXfmKdGGGvV7q70='
WHERE
key_id = '5c654a94b3dfa9381090f906f7a269644cad4301806e325ac792f009453cc35c'
AND (
token = 'FEO721THR87BzZuklv/YQpe6VobKgXfmKdGGGvV7q70='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)