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