UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'H7cguWkbzhXzTl4xwGMNm/XbeqBoLb0c2RRrUnzO5HI='
WHERE
key_id = '25348e3e239d18c0ac48adbe7076f67037fa2ea8adcb7ad0c3379eed077f3912'
AND (
token = 'H7cguWkbzhXzTl4xwGMNm/XbeqBoLb0c2RRrUnzO5HI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)