UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'awu0C9Y2fe9/lp+x3cjTS8T5oWFm/0ahK70wGUMxqVc='
WHERE
key_id = 'bbd648829a7bb8df3e212b603044c14e4a8820ea191131e735fd08aa92535871'
AND (
token = 'awu0C9Y2fe9/lp+x3cjTS8T5oWFm/0ahK70wGUMxqVc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)