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