UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2fh9m5cAlqHXiE9nDhiLwYOSpV+4iRqG/WDrgdaEH1U='
WHERE
key_id = '6a56998bdcef69e30a96d0bde09772925c442801faa402f751a372b1c7f7f549'
AND (
token = '2fh9m5cAlqHXiE9nDhiLwYOSpV+4iRqG/WDrgdaEH1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)