UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uFyNcGQck5Jrd0MACOuom3d9PiN8tdZPTxleyspdNuY='
WHERE
key_id = '5a137015ae688762c00e56d197084b7eb06e880eea2e2b44be22ef855820bb0c'
AND (
token = 'uFyNcGQck5Jrd0MACOuom3d9PiN8tdZPTxleyspdNuY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)